﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Frame.master" AutoEventWireup="true"
    CodeFile="employeeSearch.aspx.cs" Inherits="employeeSearch" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleHolder" runat="Server">
    Tìm nhân viên 
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="Server">

    <script type="text/javascript">
	$(document).ready(function () {
	    $("#tableOne").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
        .tablesorterPager({ container: $("#pagerOne"), positionFixed: false })
        .tablesorterFilter({ filterContainer: $("#filterBoxOne"),
            filterClearContainer: $("#filterClearOne"),
            filterColumns: [0, 1, 2, 3, 4, 5],
            filterCaseSensitive: false
        });	  
        
        //Tu ngay - den ngay
        initJQueryWidgets();
        
	}); 
	
	function initJQueryWidgets() {
         $("[ID$=txtFrom]").datepicker({
             changeMonth: true,
             changeYear: true
         });
         $("[ID$=txtTo]").datepicker({
             changeMonth: true,
             changeYear: true
         });
     }
     
     
     
	
	
	         
	var prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_endRequest(function() {
        $(document).ready(function () {
	    $("#tableOne").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
        .tablesorterPager({ container: $("#pagerOne"), positionFixed: false })
        .tablesorterFilter({ filterContainer: $("#filterBoxOne"),
            filterClearContainer: $("#filterClearOne"),
            filterColumns: [0, 1, 2, 3, 4, 5],
            filterCaseSensitive: false
        });	       
	});  
	
	
    });

   
    </script>

    <asp:Label ID="lblMsg" runat="server" ForeColor="#FF3300"></asp:Label>
    <table width="700" border="0" cellpadding="3" cellspacing="1" class="margin_b15 margin_l100">
        <tr id="DateGroup" runat="server">
            <td align="left" valign="top" width="150">
                Từ ngày
            </td>
            <td align="left" valign="top">
                <table border="0" cellpadding="0" cellspacing="0" width="490">
                    <tr>
                        <td align="left" valign="top" width="90">
                            <asp:TextBox ID="txtFrom" runat="server" CssClass="width_80" MaxLength="10"></asp:TextBox>
                        </td>
                        <td align="right" width="60">
                            Đến ngày&nbsp;
                        </td>
                        <td width="90" align="left">
                            <asp:TextBox ID="txtTo" runat="server" CssClass="width_80" MaxLength="10"></asp:TextBox>
                        </td>
                        <td align="left"> 
                          <div id="errorDate" style="display:none" class="errorMsg2">Chọn từ ngày đến ngày!</div>
                                                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr id="codeControl" runat="server">
            <td align="left" valign="top">
                <asp:RadioButton ID="rdoCode" runat="server" AutoPostBack="True" Checked="true" CssClass="cursorPointer"
                    GroupName="RdoGroup" OnCheckedChanged="rdoCode_CheckedChanged" Text="Mã NV " />
            </td>
            <td align="left" valign="top">
                <table border="0" cellpadding="0" cellspacing="0" width="300">
                    <tr>
                        <td align="left" valign="top" width="90">
                            <asp:TextBox ID="txtCode" runat="server" CssClass="width_80" MaxLength="10"></asp:TextBox>
                        </td>
                        <td>
                            <asp:ImageButton ID="btnSearchCode" runat="server" ImageUrl="~/images/view.gif" OnClick="btnSearchCode_Click"
                                ToolTip="Click để tìm nhân viên" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <asp:RadioButton ID="rdoSearch" runat="server" AutoPostBack="True" GroupName="RdoGroup"
                    OnCheckedChanged="rdoSearch_CheckedChanged" Text="Họ và tên đệm " CssClass="cursorPointer" />
                <asp:Literal ID="litFistName" runat="server" Text="Họ và tên đệm" Visible="False"
                    Mode="PassThrough"></asp:Literal>
            </td>
            <td align="left" valign="top">
                <table border="0" cellpadding="0" cellspacing="0" width="300">
                    <tr>
                        <td align="left" valign="top" width="90">
                            <asp:TextBox ID="txtFirstName" runat="server" CssClass="width_80" MaxLength="50"></asp:TextBox>
                        </td>
                        <td align="right" width="60">
                            Tên&nbsp;
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server" CssClass="width_80" MaxLength="50"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Giới tính
            </td>
            <td align="left" valign="top">
                <asp:CheckBoxList ID="chkGender" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True">Nam</asp:ListItem>
                    <asp:ListItem Value="False">Nữ</asp:ListItem>
                </asp:CheckBoxList>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Chức vụ
            </td>
            <td align="left" valign="top">
                <asp:DropDownList ID="cbxPosition" runat="server" CssClass="width_172">
                    <asp:ListItem>
                    </asp:ListItem>
                    <asp:ListItem Value="Quản lý">Quản lý</asp:ListItem>
                    <asp:ListItem Value="Kế toán">Kế toán</asp:ListItem>
                    <asp:ListItem Value="Nhân viên">Nhân viên</asp:ListItem>
                    <asp:ListItem Value="Bảo vệ">Bảo vệ</asp:ListItem>
                    <asp:ListItem Value="Khác">Khác</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                &nbsp;
            </td>
            <td align="left" valign="top">
                <asp:ImageButton ID="btnSearch" OnClientClick="return CheckDate()" runat="server" ImageUrl="~/images/search.gif" OnClick="btnSearch_Click" />
                <asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/images/xoa.gif" OnClick="btnReset_Click" />
                <asp:HiddenField ID="hdnMenu" runat="server" />
                <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                    <ProgressTemplate>
                        <img src="images/spinner.gif" />
                    </ProgressTemplate>
                </asp:UpdateProgress>
            </td>
        </tr>
    </table>
    <table width="612" border="0" cellpadding="0" cellspacing="0" class="margin_b5 margin_l20">
        <tr>
            <td class="titleInfo">
                Danh sách nhân viên
            </td>
        </tr>
    </table>
    <div align="center" class="margin_b10 margin_t10">
        <em>
            <asp:Label ID="msgResult" runat="server" Text=""></asp:Label></em></div>
    <asp:Repeater ID="rptEmployee" runat="server" EnableViewState="false" OnItemDataBound="rptEmployee_ItemDataBound"
        OnItemCommand="rptEmployee_ItemCommand">
        <HeaderTemplate>
            <table id="tableOne" class="yui margin_l30 margin_b5" width="930" border="0" align="center"
                cellpadding="5" cellspacing="1">
                <thead>
                    <tr>
                        <th width="20">
                            STT
                        </th>
                        <th width="70" align="center" class="tableheader">
                            Mã NV
                        </th>
                        <th align="left" class="tableheader">
                            Tên</td>
                            <th width="80" align="center" class="tableheader">
                                Ngày sinh</td>
                                <th width="60" align="center" class="tableheader">
                                    Giới tính
                                </th>
                                <th width="70" align="left" class="tableheader">
                                    Chức vụ
                                </th>
                                <th width="130" align="left" class="tableheader">
                                    Email
                                </th>
                                <th width="120" align="center" class="tableheader">
                                    <strong class="red">
                                        <asp:Label ID="lblAction" runat="server" Text="Gán ca trực"></asp:Label></strong>
                                </th>
                    </tr>
                </thead>
                <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td align="center">
                    <asp:Label ID="lblNo" runat="server" Text="<%# Container.ItemIndex + 1 %>"></asp:Label>
                </td>
                <td align="center" valign="top">
                    <%#Eval("Code")%>
                </td>
                <td align="left" valign="top">
                    <%#Eval("FirstName")%>
                    <%#Eval("LastName")%>
                </td>
                <td align="center" valign="top">
                    <%# DataBinder.Eval(Container.DataItem, "BirthDay", "{0: dd/MM/yyyy}")%>
                </td>
                <td align="center" valign="top">
                    <asp:Label ID="lblGender" runat="server" Text='<%#Eval("Gender")%>'></asp:Label>
                </td>
                <td align="left" valign="top">
                    <%#Eval("Position")%>
                </td>
                <td align="left" valign="top">
                    <%#Eval("Email")%>
                </td>
                <td align="center" valign="top">
                    <asp:ImageButton ID="imgGrant" 
                        runat="server" ImageUrl="~/images/ticket.png" CommandArgument='<%#Eval("Id")%>' ToolTip="Gán ca" Width="14" Height="13" />
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
            <tfoot>
                <tr id="pagerOne">
                    <td colspan="9" class="tableFooter padding_t5">
                        <img title="Trang đầu" alt="Trang đầu" src="images/first.png" class="first" />
                        <img src="images/prev.png" class="prev" title="Trang trước" alt="Trang trước" />
                        <input type="text" class="pagedisplay" />
                        <img src="images/next.png" class="next" title="Trang kế" alt="Trang kế" />
                        <img src="images/last.png" class="last" title="Trang sau cùng" alt="Trang sau cùng" />&nbsp;&nbsp;
                        <select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="20">20</option>
                            <option value="30">30</option>
                            <option value="40">40</option>
                        </select>
                    </td>
                </tr>
            </tfoot>
            </table>
        </FooterTemplate>
    </asp:Repeater>
</asp:Content>
